REST API
gHost sites can accept data from anywhere around the world, via each tenant's REST API.
To accept data:
- Create a new PI Server item in Settings > gHost, and give it a name (e.g. "PIWRITE")
- Point the server to a PI Data Archive, and (if required) add a common point prefix
- Create a read-write identity in PI SMT, and assign that identity to all tags that the data should be written to

- Create a role in the gHost tenancy, where the name matches the PI identity

- Assign the role to one of the accounts in the gHost tenancy (not one created via M365), or create a new user and assign the role to the new user
note
Data can now be sent to the following URL: https://[ghost_tenant_name].ghost.site/gHostModules/DataAccess/UploadData
The request should use basic authentication, with the username and password matching the account that the role was assigned to.
Requests to send data should be POSTed, with the following JSON body:
{
"Server":"PIWRITE",
"Data":[
{
"N":"Tag1.Value",
"Events":[
{
"ET":1737004123,
"V":13,
"Q":"Good"
},
{
"ET":1737004423,
"V":15,
"Q":"Good"
}
]
},
{
"N":"Tag2.Value",
"Events":[
{
"ET":1737004123,
"V":32,
"Q":"Good"
},
{
"ET":1737004423,
"V":34,
"Q":"Good"
}
]
}
]
}
Request bodies can have multiple tags and events, where:
- "N" = Tag Name
- "ET" = EventTime, in epoch format
- "V" = Value
- "Q" = Quality - typically "good"